.class Lcom/nemustech/regina/Intercepter$ScrollRunnable;
.super Ljava/lang/Object;
.source "Intercepter.java"

# interfaces
.implements Ljava/lang/Runnable;


# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
    value = Lcom/nemustech/regina/Intercepter;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x2
    name = "ScrollRunnable"
.end annotation


# instance fields
.field private mDirection:I

.field private mFastScrolling:Z

.field final synthetic this$0:Lcom/nemustech/regina/Intercepter;


# direct methods
.method constructor <init>(Lcom/nemustech/regina/Intercepter;)V
    .locals 1
    .parameter

    .prologue
    .line 1703
    iput-object p1, p0, Lcom/nemustech/regina/Intercepter$ScrollRunnable;->this$0:Lcom/nemustech/regina/Intercepter;

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 1701
    const/4 v0, 0x0

    iput-boolean v0, p0, Lcom/nemustech/regina/Intercepter$ScrollRunnable;->mFastScrolling:Z

    .line 1704
    return-void
.end method


# virtual methods
.method public run()V
    .locals 10

    .prologue
    const/4 v9, 0x1

    .line 1707
    const/4 v1, 0x0

    .line 1708
    .local v1, targetIndex:I
    iget-object v4, p0, Lcom/nemustech/regina/Intercepter$ScrollRunnable;->this$0:Lcom/nemustech/regina/Intercepter;

    invoke-static {v4}, Lcom/nemustech/regina/Intercepter;->access$300(Lcom/nemustech/regina/Intercepter;)Lcom/nemustech/regina/ReginaLauncher;

    move-result-object v4

    invoke-virtual {v4}, Lcom/nemustech/regina/ReginaLauncher;->getElementLocator()Lcom/nemustech/regina/ElementLocator;

    move-result-object v0

    .line 1709
    .local v0, locator:Lcom/nemustech/regina/ElementLocator;
    invoke-virtual {v0}, Lcom/nemustech/regina/ElementLocator;->getWorkspaceCount()I

    move-result v2

    .line 1710
    .local v2, workspaceMax:I
    invoke-virtual {v0}, Lcom/nemustech/regina/ElementLocator;->getCurrentWorkspaceIndex()I

    move-result v3

    .line 1711
    .local v3, wsCurIndex:I
    iget-object v4, p0, Lcom/nemustech/regina/Intercepter$ScrollRunnable;->this$0:Lcom/nemustech/regina/Intercepter;

    invoke-static {v4, v3}, Lcom/nemustech/regina/Intercepter;->access$2602(Lcom/nemustech/regina/Intercepter;I)I

    .line 1714
    iget-object v4, p0, Lcom/nemustech/regina/Intercepter$ScrollRunnable;->this$0:Lcom/nemustech/regina/Intercepter;

    invoke-static {v4}, Lcom/nemustech/regina/Intercepter;->access$1400(Lcom/nemustech/regina/Intercepter;)Lcom/nemustech/regina/Element;

    move-result-object v4

    if-eqz v4, :cond_0

    .line 1715
    iget v4, p0, Lcom/nemustech/regina/Intercepter$ScrollRunnable;->mDirection:I

    if-nez v4, :cond_1

    .line 1716
    sub-int v4, v3, v9

    add-int/2addr v4, v2

    rem-int v1, v4, v2

    .line 1725
    :goto_0
    iget-object v4, p0, Lcom/nemustech/regina/Intercepter$ScrollRunnable;->this$0:Lcom/nemustech/regina/Intercepter;

    invoke-static {v4, v1}, Lcom/nemustech/regina/Intercepter;->access$2900(Lcom/nemustech/regina/Intercepter;I)V

    .line 1726
    iget-object v4, p0, Lcom/nemustech/regina/Intercepter$ScrollRunnable;->this$0:Lcom/nemustech/regina/Intercepter;

    const/4 v5, 0x0

    invoke-static {v4, v1, v5}, Lcom/nemustech/regina/Intercepter;->access$3000(Lcom/nemustech/regina/Intercepter;ILcom/nemustech/regina/Element;)V

    .line 1727
    const-string v4, "Intercepter"

    const-string v5, "workspaceindex=%d is AnimationMode"

    new-array v6, v9, [Ljava/lang/Object;

    const/4 v7, 0x0

    invoke-static {v1}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v8

    aput-object v8, v6, v7

    invoke-static {v5, v6}, Ljava/lang/String;->format(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v5

    invoke-static {}, Lcom/nemustech/regina/Intercepter;->access$2000()Z

    move-result v6

    invoke-static {v4, v5, v6}, Lcom/nemustech/regina/RLog;->d(Ljava/lang/String;Ljava/lang/String;Z)I

    .line 1729
    iget-boolean v4, p0, Lcom/nemustech/regina/Intercepter$ScrollRunnable;->mFastScrolling:Z

    if-ne v4, v9, :cond_2

    .line 1730
    const/16 v4, 0x32

    invoke-virtual {v0, v1, v4}, Lcom/nemustech/regina/ElementLocator;->scrollWorkspace(II)V

    .line 1734
    :goto_1
    iget-object v4, p0, Lcom/nemustech/regina/Intercepter$ScrollRunnable;->this$0:Lcom/nemustech/regina/Intercepter;

    invoke-static {v4}, Lcom/nemustech/regina/Intercepter;->access$1400(Lcom/nemustech/regina/Intercepter;)Lcom/nemustech/regina/Element;

    move-result-object v4

    invoke-virtual {v0, v1}, Lcom/nemustech/regina/ElementLocator;->getWorkspace(I)Lcom/nemustech/regina/RGWorkspace;

    move-result-object v5

    invoke-virtual {v4, v5}, Lcom/nemustech/regina/Element;->setWorkspace(Lcom/nemustech/regina/RGWorkspace;)V

    .line 1736
    :cond_0
    return-void

    .line 1719
    :cond_1
    add-int/lit8 v4, v3, 0x1

    rem-int v1, v4, v2

    goto :goto_0

    .line 1732
    :cond_2
    const/16 v4, 0x50

    invoke-virtual {v0, v1, v4}, Lcom/nemustech/regina/ElementLocator;->scrollWorkspace(II)V

    goto :goto_1
.end method

.method setDirection(I)V
    .locals 0
    .parameter "direction"

    .prologue
    .line 1739
    iput p1, p0, Lcom/nemustech/regina/Intercepter$ScrollRunnable;->mDirection:I

    .line 1740
    return-void
.end method

.method setFastScrolling(Z)V
    .locals 0
    .parameter "fast"

    .prologue
    .line 1743
    iput-boolean p1, p0, Lcom/nemustech/regina/Intercepter$ScrollRunnable;->mFastScrolling:Z

    .line 1744
    return-void
.end method
